package net.koodar.forge.system.role.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import net.koodar.forge.mybatis.doman.BaseEntity;

/**
 * @author liyc
 */
@Data
@TableName("sys_user_role")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class UserRole extends BaseEntity<UserRole> {

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 用户 id
	 */
	@TableField("user_id")
	private Long userId;

	/**
	 * 角色 id
	 */
	@TableField("role_id")
	private Long roleId;

	public UserRole(Long userId, Long roleId) {
		this.userId = userId;
		this.roleId = roleId;
	}
}
